# ifndef __HoluxWpt_H_
# define __HoluxWpt_H_

# ifdef _MSC_VER
#	pragma pack (push, 1)
# endif

const WORD c_wWptWptSignature = 0x2483;
const size_t c_cWptMaxWaypoints = 500;

struct CWptWaypointsHdr {
	WORD wSignature;
	WORD wCurrentWaypoints;
	WORD wNextWaypoints;

	WORD wIdx   [c_cWptMaxWaypoints];
	BYTE btUsed [c_cWptMaxWaypoints];

	BYTE btUnknown [1506]; // 0xFF
};

struct CWptWaypoint {
	char  strName [8];
	char  strComment [12];

	LONG  lX, lY;

	DWORD dwDate;
	DWORD dwTime;

	WORD  wRoutesRefs;
	BYTE  btFlags;     // 0x4 - is active, 0 - not active
	BYTE  btReserved;  // 0 or 0xFF
};

const WORD c_wWptRoutesSignature = 0x1643;
const size_t c_cWptMaxRoutes = 20;
const size_t c_cWptMaxWaypointsInRoute = 30;

struct CWptRoutesHdr {
	WORD wSignature;

	WORD wCurrentRoutes;
	WORD wNextRoutes;

	WORD wReserved1;

	WORD wIdx   [c_cWptMaxRoutes];
	BYTE btUsed [c_cWptMaxRoutes];

	WORD wNavigationRoute;

	WORD wReserved2;
	BYTE btReserved [64];   // 0xFF
};

struct CWptRoute {
	char  strName    [8];
	char  strComment [12];

	WORD  wWaypoints;
	WORD  wWptIdx [c_cWptMaxWaypointsInRoute];

	WORD  wReserved;

	DWORD dwDate;
	DWORD dwTime;
};

struct CWptFile {
	CWptWaypointsHdr WptHdr;
	CWptWaypoint     Waypoints [c_cWptMaxWaypoints];

	BYTE             btUnused [0x61c]; // 0xFF

	// Offset = 0x6000
	CWptRoutesHdr    RoutesHdr;
	CWptRoute        Routes [c_cWptMaxRoutes];

	BYTE             btUnused2 [0x1848];
};

# ifdef _MSC_VER
#	pragma pack (pop)
# endif

# endif // __HoluxWpt_H_